package com.csi.controller.back;

import com.csi.domain.HotCity;
import com.csi.domain.Result;
import com.csi.service.HotCityService;
import com.csi.utils.ReturnResults;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/hotCity")
public class HotCityController {
    @Autowired
    private HotCityService hotCityService;
    @GetMapping("/showHotCity")
    public Object showHotCity() {
        List<HotCity> hotCityList = hotCityService.showHotCity();
        if (hotCityList != null) {
            return new Result<>("查询成功！", ReturnResults.ACCESS_SUCCESS, hotCityList);
        }
        return new Result<>("查询失败！",ReturnResults.ACCESS_FAILED);
    }
}

